﻿<ResourceDictionary   
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
   xmlns:local="clr-namespace:Orbifold.Unfold.Main"
    >
  <Style x:Key="IconStyle" TargetType="{x:Type Canvas}">
    <Setter Property="Height" Value="24"/>
    <Setter Property="Width" Value="24"/>
    <Setter Property="Margin" Value="2"/>
  </Style>
  
  <DataTemplate DataType="RibbonItem">
    <Button  ToolTipService.InitialShowDelay="1500" ToolTipService.ShowOnDisabled="True" >
      <Button.Command>
        <MultiBinding Converter="{StaticResource commandConverter}" >
          <Binding XPath="@Name"/>
          <Binding RelativeSource="{x:Static RelativeSource.Self}"/>
        </MultiBinding>
      </Button.Command>
      <Button.ToolTip>
        <ToolTip Content="{Binding}">
          <ToolTip.ContentTemplate>
            <DataTemplate>
              <StackPanel>
                <TextBlock Text="{Binding XPath=Header}" FontWeight="Bold" Foreground="#4C4C4C"/>
                <TextBlock Text="{Binding XPath=Description}" Margin="0,5,0,0" Foreground="#4C4C4C"/>
              </StackPanel>
            </DataTemplate>
          </ToolTip.ContentTemplate>
        </ToolTip>
      </Button.ToolTip>
      <Viewbox>
        <Canvas 
            Style="{StaticResource IconStyle}" 
            Background="{Binding XPath=@Name, Converter={StaticResource backgroundConverter}}"/>
      </Viewbox>
    </Button>
  </DataTemplate>
</ResourceDictionary>